package com.excesys.exsecs.access.entity;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;

/**
 * 物模型表
 *
 * @author lxc
 * @date 2024-05-06 17:44:02
 */
@Data
@TableName(value = "access_thing_model", autoResultMap = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "物模型表")
public class AccessThingModel extends Model<AccessThingModel> {


	/**
	* 主键id
	*/
    @TableId(type = IdType.AUTO)
    @Schema(description="主键id")
    private Long id;

	/**
	* 产品key
	*/
    @Schema(description="产品key")
    private String productKey;

	/**
	 * 产品名称
	 */
	@Schema(description="产品名称")
	@TableField(exist = false)
	private String productName;

	/**
	* 物模型json
	*/
    @Schema(description="物模型json")
	@TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONObject model;

	/**
	* 创建人
	*/
	@TableField(fill = FieldFill.INSERT)
    @Schema(description="创建人")
    private String createBy;

	/**
	* 创建时间
	*/
	@TableField(fill = FieldFill.INSERT)
    @Schema(description="创建时间")
    private LocalDateTime createTime;

	/**
	* 更新人
	*/
	@TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description="更新人")
    private String updateBy;

	/**
	* 更新时间
	*/
	@TableField(fill = FieldFill.INSERT_UPDATE)
    @Schema(description="更新时间")
    private LocalDateTime updateTime;
}